package daily.kou2022_0108;

public class Num268 {
    //268. 丢失的数字
    public static int missingNumber(int[] nums) {

        int length=nums.length;
        if(length<=0){
            return 0;
        }
        int ret=0;
        for (int i = 0; i < length; i++) {
            ret^=i^nums[i];
        }
        return ret^length;

    }
}
